package com.yjtc.cbg.commonutildemo.View;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.yjtc.cbg.commonutildemo.R;

/**
 * Created by chenboge on 16/8/2.
 * 定制activity切换动画
 */
public abstract class BaseActivity extends Activity {

    protected Context mContext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getContentVIew());
        mContext = this;
        initData();
    }

    @Override
    public void startActivity(Intent intent) {
        super.startActivity(intent);
        overridePendingTransition(R.anim.activity_in_anim,R.anim.activity_out_anim);
    }

    @Override
    public void finish() {
        super.finish();
        overridePendingTransition(R.anim.activity_out_anim, R.anim.activity_in_anim);
    }

    public abstract int getContentVIew();

    public void initData(){}
}
